const getTreeData = (size) => {
    const result = []
    let idKey = 0
    for (let index = 0; index < size; index++) {
        const item = {
            id: ++idKey,
            label: `节点 ${index}`
        }
        if (index) {
            if (index % 33 === 0) {
                const childList = []
                for (let cIndex = 0; cIndex < 1000; cIndex++) {
                    childList.push({
                        id: ++idKey,
                        label: `子节点 ${index}-${cIndex}`,
                        children: [
                            { label: `子节点 ${index}-${cIndex}-0` },
                            { label: `子节点 ${index}-${cIndex}-1` },
                            { label: `子节点 ${index}-${cIndex}-2` },
                            { label: `子节点 ${index}-${cIndex}-3` },
                            { label: `子节点 ${index}-${cIndex}-4` },
                            { label: `子节点 ${index}-${cIndex}-5` },
                            { label: `子节点 ${index}-${cIndex}-6` },
                            { label: `子节点 ${index}-${cIndex}-7` }
                        ]
                    })
                }
                item.children = childList
            } else if (index % 22 === 0) {
                const childList = []
                for (let cIndex = 0; cIndex < 500; cIndex++) {
                    childList.push({
                        id: ++idKey,
                        label: `子节点 ${index}-${cIndex}`,
                        children: [
                            { label: `子节点 ${index}-${cIndex}-0` },
                            { label: `子节点 ${index}-${cIndex}-1` },
                            { label: `子节点 ${index}-${cIndex}-2` }
                        ]
                    })
                }
                item.children = childList
            } else if (index % 9 === 0) {
                const childList = []
                for (let cIndex = 0; cIndex < 200; cIndex++) {
                    childList.push({
                        id: ++idKey,
                        label: `子节点 ${index}-${cIndex}`,
                        children: [
                            { label: `子节点 ${index}-${cIndex}-0` },
                            { label: `子节点 ${index}-${cIndex}-1` },
                            { label: `子节点 ${index}-${cIndex}-2` },
                            { label: `子节点 ${index}-${cIndex}-4` },
                            { label: `子节点 ${index}-${cIndex}-5` }
                        ]
                    })
                }
                item.children = childList
            } else if (index % 6 === 0) {
                const childList = []
                for (let cIndex = 0; cIndex < 100; cIndex++) {
                    childList.push({
                        id: ++idKey,
                        label: `子节点 ${index}-${cIndex}`,
                        children: [
                            { label: `子节点 ${index}-${cIndex}-0` },
                            { label: `子节点 ${index}-${cIndex}-1` },
                            { label: `子节点 ${index}-${cIndex}-2` },
                            { label: `子节点 ${index}-${cIndex}-3` }
                        ]
                    })
                }
                item.children = childList
            } else if (index % 3 === 0) {
                const childList = []
                for (let cIndex = 0; cIndex < 10; cIndex++) {
                    childList.push({
                        id: ++idKey,
                        label: `子节点 ${index}-${cIndex}`,
                        children: [
                            { label: `子节点 ${index}-${cIndex}-0` },
                            { label: `子节点 ${index}-${cIndex}-1` }
                        ]
                    })
                }
                item.children = childList
            }
        }
        result.push(item)
    }
    return result
}

export default {
    getTreeData
}